using System;
using NServiceBus;

namespace EmailGateway
{
public class SendEmailMessageHandler : IMessageHandler<SendEmailRequest>
{
    private readonly IEmailGateway emailGateway;

    public SendEmailMessageHandler(IEmailGateway emailGateway)
    {
        this.emailGateway = emailGateway;
    }

    public void Handle(SendEmailRequest message)
    {
        emailGateway.SendEmail(message.ToAdress,
            message.Subject,
            message.Body);
    }
}
}